import axios from "../axios";
const project = {
  parentproj: async function(params) {
    return await axios({
      method: "post",
      url: "/school/findPage",
      data: params
    });
  },
  projectid: async function(id) {
    return await axios({
      method: "get",
      url: "/parentProj/list/" + id
    });
  },
  //新增父项目
  addproject: async function(params) {
    return await axios({
      method: "post",
      url: "/parentProj/add",
      data: params,
      header: {
        "Content-Type": "application/json"
        // 'Content-Type':'multipart/form-data'
      }
    });
  },
  //修改
  updateproject: async function(updatemsg) {
    return await axios({
      method: "post",
      url: "/parentProj/update",
      data: updatemsg,
      header: {
        "Content-Type": "application/json"
        // 'Content-Type':'multipart/form-data'
      }
    });
  },
  //删除父项目
  delproject: async function(id) {
    return await axios({
      method: "post",
      url: "/parentProj/delete/" + id
    });
  },
  //查询子项目
  childproj: async function(params) {
    return await axios({
      method: "get",
      url: "/subProj/listAll?",
      params: params
    });
  },
  //新增子项目
  addchildproj: async function(addmsg) {
    return await axios({
      method: "post",
      url: "/subProj/add",
      data: addmsg,
      header: {
        "Content-Type": "application/json"
        // 'Content-Type':'multipart/form-data'
      }
    });
  },
  //根(据id查询子项目信息
  childprojid: async function(id) {
    return await axios({
      method: "get",
      url: "/subProj/list/" + id
    });
  },
  //删除子项目
  delchildproj: async function(id) {
    return await axios({
      method: "post",
      url: "/subProj/delete/" + id
    });
  },
  //修改子项目
  updatechildproj: async function(updatemsg) {
    return await axios({
      method: "post",
      url: "/subProj/update",
      data: updatemsg,
      header: {
        "Content-Type": "application/json"
        // 'Content-Type':'multipart/form-data'
      }
    });
  },
};
const parentproj = project.parentproj;
const projectid = project.projectid;
const addproject = project.addproject;
const updateproject = project.updateproject;
const delproject = project.delproject;
const childproj = project.childproj;
const addchildproj = project.addchildproj;
const childprojid = project.childprojid;
const delchildproj = project.delchildproj;
const updatechildproj = project.updatechildproj;
export {
  parentproj,
  projectid,
  addproject,
  updateproject,
  delproject,
  childproj,
  addchildproj,
  childprojid,
  delchildproj,
  updatechildproj
};
